package com.byxm.wlgw.service;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import com.byxm.wlgw.bean.SpxxtpBean;
import com.byxm.wlgw.common.DataBaseAccess;
import com.byxm.wlgw.query.SpxxtpQuery;

public class SpxxtpService {
    SpxxtpQuery spxxtpQuery=new SpxxtpQuery();
    String sql=spxxtpQuery.getSpxxtpSql();
    ResultSet rs=null;
    DataBaseAccess dba=null;
    public List<SpxxtpBean> getSpxxtp(){
    	List<SpxxtpBean> list = new ArrayList<SpxxtpBean>();
    	try {
			dba= new DataBaseAccess();
			rs=dba.executeQuery(sql);
			while(rs.next()){
				SpxxtpBean spxxtpBean= new SpxxtpBean();
				spxxtpBean.setSpxxtpid(rs.getInt("spxxtpid"));
				spxxtpBean.setSpxxtp(rs.getString("spxxtp"));
				
				list.add(spxxtpBean);
			}
			rs.close();
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			try {
				dba.releaseConnect();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
    	return list;
    }
}
